package com.carpool.finder;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.Button;
import android.widget.ListView;
import android.widget.Toast;

@SuppressLint("SetJavaScriptEnabled")
public class RegisterActivity extends Activity{
	
	Button login;
	
	@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.register);
        //Toast.makeText(getBaseContext(), "Register!!! Coming soon !!!", Toast.LENGTH_SHORT).show();
        login = (Button)findViewById(R.id.btnLinkToLoginScreen);
        AlertDialog.Builder alert = new AlertDialog.Builder(this);

        //alert.setTitle("Google Sign in");
        WebView wv = new WebView(this);

        wv.loadUrl("http://10.0.2.2/carpooltest/");
        WebSettings webSettings = wv.getSettings();
        webSettings.setJavaScriptEnabled(true);
        wv.setWebViewClient(new WebViewClient()
        {
            @Override
            public boolean shouldOverrideUrlLoading(WebView view, String url)
            {
                view.loadUrl(url);

                return true;
            }
        });

        alert.setView(wv);
        alert.setNegativeButton("Close", new DialogInterface.OnClickListener()
        {
            @Override
            public void onClick(DialogInterface dialog, int id)
            {
            }
        });
        alert.show();
        
        login.setOnClickListener(new View.OnClickListener() {
 
            public void onClick(View view) {
                Intent i = new Intent(getApplicationContext(),LoginActivity.class);
                startActivity(i);
                finish();
            	//Toast.makeText(getBaseContext(), "Register!!! Coming soon !!!", Toast.LENGTH_SHORT).show();
            }
        });
	}
	
}
